A preferred route between an origin location and a destination location may be determined by a computer system. A computer system may be used to search for an optimal path through a directed graph (e.g., a collection of nodes and edges) that represents a network of roads and intersections. Each edge (or line) of the graph may represent a road in a map, and each node of the graph may represent an intersection of two or more roads or a terminal point of a road, such as a dead end road. The path that requires the least distance or time may be determined, for example, by using the Dijkstra method or A* method. The conventional Dijkstra method or A* method may determine the optimal route based on the distance and/or time required to travel between two nodes.